package com.hmy.finance.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * 业务单据类型枚举
 *
 * @author songkf
 */

@Getter
public enum BusinessBillTypeEnum {
    //业务单据类型 (1-进场, 2-退场, 3-索赔, 4-报停, 5-应收)
    ENTRY("1", "进场"),
    EXIT("2", "退场"),
    CLAIMS("3", "索赔"),
    PAUSE("4", "报停"),
    RECEIVABLE_ADJUSTMENT("5", "应收调整");
    @EnumValue
    private final String value;
    private final String desc;

    private BusinessBillTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    //获取desc
    public static String getDesc(String value) {
        for (BusinessBillTypeEnum e : values()) {
            if (e.getValue().equals(value)) {
                return e.getDesc();
            }
        }
        return null;
    }
}